#!/bin/bash

num_server=$2
ip_server=10.1.212.

if [ $1 -eq 1 ]; then

    killall iperf
    echo "start iperf2 : $num_server process"

    for((i=1; i<=$num_server; i++))
    do
        exec iperf -s -B $ip_server`expr 120 + $i` -i 1 -N -e &
    done

else

    killall iperf
    echo "stop all iperf"

fi
